import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Ap0stoL2
 * Date: 2023-07-22
 * Time: 22:23
 */
public class test1 {
    public static void main(String[] args) {
        String str = " hello world " ;
        System.out.println("["+str+"]");
        System.out.println("["+str.trim()+"]");


        String str4 = "   hell  oo  p   0   pppp";
        System.out.println(str4.trim()); //去除字符串左右空格
        System.out.println(str4);
    }
    public static void main1(String[] args) {
        Set<String> s = new TreeSet<>();

        s.add("c");
        s.add("d");
        s.add("b");
        s.add("a");
        Iterator<String> it = s.iterator();
        while (it.hasNext()) {
            System.out.print(it.next() + " ");
        }

        for(String e: s){
            System.out.print( e + " ");
        }


    }
}
